<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researchsubject.domain.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.page.*,com.hs.core.utils.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 
List resultList = null;
String pageStr = ""; 
QueryPage query = (QueryPage)request.getAttribute("query");
int perpageCount = query.getPerpagenum();
int currentPage = query.getCurrentPageNo(); 
   resultList = (List)request.getAttribute("achieveList");
   pageStr = (String)request.getAttribute("pageStr");
   
 
String subjectname = (String)request.getAttribute("subjectname"); 
String achievename = (String)request.getAttribute("achievename"); 
String regid = (String)request.getAttribute("regid"); 
String regUser = (String)request.getAttribute("regUser"); 
String snumber = (String)request.getAttribute("snumber"); 
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>课题信息</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <link href="<%=path%>/index/Themes/com/style.css" rel="stylesheet" type="text/css" /> 
    <script src="<%=path%>/index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=path%>/js/common.js" language="javascript" type="text/javascript"></script>
       <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script>
   
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
       function delSubject(id){
       		if(null != id && id != '' ){
       		 	if(confirm("确认删除课题?")){
       		 		form1.action = '<%=path%>/subjectToAdd.htm?action=delSubject&id='+id;
       		 		form1.submit();
       		 	}
       		}
       
       }
       function searchSubject(){  
       			searchform.submit();			
       }
       var selectSubjectId = '';
       function submitAudit(subjectId){
          if(confirm('课题提交审批后将不能修改，确认提交?')){
	          if('' != subjectId){
	          	subject.submitAudit(subjectId,submitCallback)
	            selectSubjectId = subjectId;
	          }  
	      }
       }
       function submitCallback(message){
         if("0" == message){
            alert("课题提交审批失败");
         }
          if("1" == message){
            document.getElementById('status_' + selectSubjectId).innerHTML='申报中';
            document.getElementById('oper_' + selectSubjectId).innerHTML='';
            document.getElementById('edit_' + selectSubjectId).innerHTML='';
            document.getElementById('del_' + selectSubjectId).innerHTML='';
            alert("课题提交审批成功");
         }
       }
       function addAchieve(){
          var subjects = document.getElementsByName("subjectId");
          var subjectId = "";
          for(var i =0;i<subjects.length;i++){
          	if(subjects[i].checked){
                  subjectId = subjects[i].value;
                  break;
            }
          }
          if("" == subjectId){
             alert("请选择要添加成果的课题");
             return;
          }
          //alert(subjectId);
          window.location.href="<%=path%>/achieve.htm?action=addView&subjectId="+subjectId;
       
       }
       function relationSubject(id){ 
          openwindow("<%=path%>/achieve.htm?action=resultSubject&achId="+id,'1024','768','');
       
       }
        function resultCup(id){
          
          openwindow("<%=path%>/achieve.htm?action=resultCup&achId="+id,'800','600','');
       
       }
       function editResult(id){
       
          document.location.href = "<%=path%>/achieve.htm?action=addView&achId="+id;
       }
       function delResult(id){
          if(confirm("确认要删除该成果？")){
             subject.delResult(id,delResultCallBack);
          }
       }
       function delResultCallBack(message){
          alert(message);
          document.location.replace(window.location.href);
       }
    </script>

</head>
<body class="rtm_body" scroll=yes>
<form name="searchform" action = "<%=path%>/achieve.htm?action=list" method="post">
    <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <span>
                <img src="<%=path%>/index/Themes/com/idt_tb_pass.gif" />&nbsp;&nbsp;课题成果管理</span>
        </div>
    </div>  
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
        <tr>
            <td class="fim_l">
                成果名称：</td>
            <td class="fim_r">
                <input type="text" name="achievename" value="<%=achievename==null?"":achievename %>" class="com_textbox" ></td>
                 <td class="fim_l">
                成果完成人：</td>
            <td class="fim_r">
                <input type="text" name="regUser" value="<%=regUser==null?"":regUser %>" class="com_textbox" id="Text2" name="Text2"></td>
             
             
            <td class="fim_r" align="right" colspan="2">
                <input type="submit"  value=" 查  询 "  onclick="searchSubject()" class="com_btn2" id="Button5">
                
                
            </td>
        </tr> 
        </form>
    </table> 
   
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <div class="content">
                 <form name="form1" action="" method="post">
                    <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4">
                        <tr>
                            <td class="dg_headerstyle">
                                序号</td>
                           <td class="dg_headerstyle" width="30%">
                                 <a href="javaScript:orderPage('achievename','<%=OrderTool.getOrderNum("achievename",orderName,orderNum)%>');">成果名称&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("achievename",orderName,orderNum))%></a></td>
                            <td class="dg_headerstyle" width="15%">
                                <a href="javaScript:orderPage('regid','<%=OrderTool.getOrderNum("regid",orderName,orderNum)%>');">登记号&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("regid",orderName,orderNum))%></a></td>
                           
                            <td class="dg_headerstyle">
                                <a href="javaScript:orderPage('regdate','<%=OrderTool.getOrderNum("regdate",orderName,orderNum)%>');">登记时间&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("regdate",orderName,orderNum))%></a></td>
                                 <td class="dg_headerstyle">
                                <a href="javaScript:orderPage('regorg','<%=OrderTool.getOrderNum("regorg",orderName,orderNum)%>');">登记单位&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("regorg",orderName,orderNum))%></a></td>
                                 <td class="dg_headerstyle">
                                <a href="javaScript:orderPage('year','<%=OrderTool.getOrderNum("year",orderName,orderNum)%>');">成果所属年份&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("year",orderName,orderNum))%></a></td>
                                
                                  <td class="dg_headerstyle" width="4%">
                                 关联课题</td>
                                 <td class="dg_headerstyle" width="4%">
                                 获奖信息</td>
                                <!--   <td class="dg_headerstyle" width="4%">
                                 
                                查看</td> -->
                                 <td class="dg_headerstyle" width="4%">
                                编辑</td> 
                                 <td class="dg_headerstyle" width="4%">
                                删除</td> 
                             
                                 
                        </tr>
                        <%if(null != resultList && resultList.size()> 0){
                            for(int i = 0;i < resultList.size();i++){
                            	Map obj = (Map)resultList.get(i); 
                         %>
                        <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                            
                            <td width="5%" align="center"><%=(i+1)+perpageCount*(currentPage-1) %></td>
                            <td >
                             <%=StringUtilTool.NULL2Blank(obj.get("ACHIEVENAME")+"") %>
                            </td>
                            <td width="20%">
                               <%=StringUtilTool.NULL2Blank(obj.get("REGID")+"") %> 
                            </td>
                            <td align="center">
                              
                                <%=Tools.getDateStringByDate1((Date)obj.get("REGDATE")) %>
                            </td>
                            <td>
                                 <%=StringUtilTool.NULL2Blank(obj.get("REGORG")+"") %> 
                            </td>
                            <td>
                                 <%=StringUtilTool.NULL2Blank(obj.get("YEAR")+"") %> 
                            </td>
                            
                            <td align="center">
                                <img src="<%=path %>/index/Themes/com/pm_fim_i3.gif" alt="课题关联"  style="cursor:hand" onclick="openwindow('<%=path%>/achieve.htm?action=resultSubject&achId=<%=obj.get("ID") %>','1024','768','');"/>
                            </td>
                            <td align="center">
                                <img src="<%=path %>/index/Themes/com/pm_fim_i2.gif" alt="获奖信息"  style="cursor:hand" onclick="openwindow('<%=path%>/achieve.htm?action=resultCup&achId=<%=obj.get("ID") %>','800','600','');"/>
                            </td>
                            <!--  
                            <td align="center">
                                 <img src="<%=path %>/index/Themes/com/zoom_16x16.gif" alt="查看"  style="cursor:hand" onclick="viewResult('<%=obj.get("ID") %>');"/>
                            </td>-->
                            <td align="center">
                                   <img src="<%=path %>/index/Themes/com/68design.net_registration1_(edit)_16x16.gif" alt="编辑"  style="cursor:hand" onclick="editResult('<%=obj.get("ID") %>');"/>
                            </td>
                             <td align="center">
                                   <img src="<%=path %>/index/Themes/com/68design.net_registration1_(delete)_16x16.gif" alt="删除"  style="cursor:hand" onclick="delResult('<%=obj.get("ID") %>');"/>
                            </td>
                             
                        </tr> 
                        <%}}else{%>
                         <tr class="dg_alternatingitemstyle"> 
                            <td align="center" colspan=11>
                                <font color="red">没有找到记录</font>
                            </td> 
                        </tr> 
                        <%}%>
                    </table>
                    </form>
                    <div class="dg_pagerstyle" align="right"> 
                            <%=pageStr %>  
                    </div>
                    
                </div>
            </td>
        </tr>
    </table>
</body>
</html>
